package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.AnalysisDto;
import com.heima.wemedia.service.WmStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.ParseException;

@Api("自媒体用户数据统计api")
@RestController
@RequestMapping("/api/v1/statistics")
public class WmUserBehaviorController {
    @Autowired
    WmStatisticsService wmStatisticsService;
    @ApiOperation("自媒体用户数据展示接口")
    @PostMapping("/news")
    public ResponseResult statisticsNews(@RequestBody AnalysisDto dto) throws ParseException {
         return wmStatisticsService.news(dto);

    }
    @ApiOperation("粉丝概况接口")
    @PostMapping("/fans")
    public ResponseResult fansStatistics(@RequestBody AnalysisDto dto){
        return wmStatisticsService.fans(dto);
    }
}
